package rgbos.forum.domain;

import java.util.Vector;

import rgbos.forum.persistance.Persistance;

public class ForumCtrlPost {
	private Persistance pres_;

	public ForumCtrlPost(Persistance pers) {
		this.pres_ = pers;
	}

	public synchronized int saveNewPost(Post post,int topicId){
		return this.pres_.saveNewPost(post,topicId);
	}
	public synchronized boolean modifyPost(int postId,String title, String newMsg){
		return this.pres_.modifyPostBody(postId, title,newMsg);
	}
	public synchronized boolean deletePost(int postId){
		return this.pres_.deletePost(postId );
	}
	public synchronized Vector<Post> getPosts() {
		return this.pres_.getPosts();
	}
	public synchronized Post getPostById(int postId){
		return this.pres_.getPostById(postId);
	}

	public boolean checkAuthor(String username, int postId) {
		return false;
	}

	public Vector<Post> getPostsByUser(String username) {
		return this.pres_.getPostsByUser(username);
	}
}
